-
-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ADD] crm_lead_substage: Substages for leads/opportunities #74
Conversation
@rafaelbn, please check |
3a13c66
to
acbf9f5
Compare
@pedrobaeza I tried to install it on my local. Installation failed with log below: File "/home/andhit_r/odoo8/oca_crm/crm_lead_substage/report/crm_lead_report.py", line 24, in init I then raise your view_def variable. It showed: SELECT c.i c.substage_id, I think You miss a comma (,) after c.id |
Same error showed on travis |
I think it's because another module in this repo also overwrites the lead report without respecting inheritance chain (it's not easy in this case though). |
This module only depend crm. I tested on fresh DB with demo data. I installed only this module after DB creation. No other module in this repo installed. |
Here it's the trick I use to insert the field: https://github.com/OCA/crm/pull/74/files#diff-9f5df14bda3a6d61aac3b7c881180811R16 Maybe this is not the same in your Odoo revision? |
@pedrobaeza I'm using Odoo a688bcd and crm repo from your fork (8.0-crm_lead_substate) acbf9f5 . I can not install crm_lead_substate due error i mentioned previously |
@pedrobaeza are you going to insert substage_id or replace stage_id with substage_id on crm.lead.report? |
I'm inserting it, but the lack of inheritable methods for select, from and where parts make me do it that way to also allow another inheritances into account. |
cr.execute("SELECT pg_get_viewdef('crm_lead_report', true)") | ||
view_def = cr.fetchone()[0] | ||
# Inject the new field in the expected SQL | ||
sql = "c.stage_id,\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to change into sql = "c.stage_id,"
================================= Substages for leads/opportunities ================================= This module allows to set substages inside the same stage for fine-graining the reasons or flows on the CRM pipelines. Configuration ============= Go to Sales > Configuration > Leads & Opportunities > Substages for defining the substages you want and set the stages where this substages are going to be available Usage ===== Go to Sales > Leads or Sales > Opportunities, and when you are in one stage, the available substages are shown below. Click on one of them to set it. If you change the stage, then the substage is reset and the new ones available for this stage are shown.
acbf9f5
to
c55d694
Compare
I have used another part of the sentence that is going to be for sure (the SELECT part), so now it's working. Runbot red status is because a warning. Thanks for your reviews. |
Tested on runbot 👍 |
@api.multi | ||
def onchange_stage_id(self, stage_id): | ||
res = super(CrmLead, self).onchange_stage_id(stage_id) | ||
res['value'] = res.get('value', {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
res.setdefault()
seems cleaner.
I worry about the functional rationale for this feature - could it be adding avoidable complexity? |
|
||
Go to Sales > Configuration > Leads & Opportunities > Substages for defining | ||
the substages you want and set the stages where this substages are going to be | ||
available |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
period
Like @dreispt I am not sure about the rationale here but it is not a real blocking point |
We will rethink this now and come back here. I close for now. |
Substages for leads/opportunities
This module allows to set substages inside the same stage for fine-graining
the reasons or flows on the CRM pipelines.
Configuration
Go to Sales > Configuration > Leads & Opportunities > Substages for defining
the substages you want and set the stages where this substages are going to be
available
Usage
Go to Sales > Leads or Sales > Opportunities, and when you are in one stage,
the available substages are shown below. Click on one of them to set it. If you
change the stage, then the substage is reset and the new ones available for
this stage are shown.